package com.langfeiyes.pattern.builder;

//果汁生产线
public class FruitJuiceBuilder implements IBuilder{
    private String ingredient;  //配料
    private String packing;    //瓶子的包装
    private String drink;        //饮料
    @Override
    public IBuilder ingredientHandler(String ingredient) {
        this.ingredient = ingredient;
        return this;
    }
    @Override
    public IBuilder fillDrink(String drink) {
        this.drink = drink;
        return this;
    }
    @Override
    public IBuilder packing(String packing) {
        this.packing = packing;
        return this;
    }
    @Override
    public FruitJuice build() {
        FruitJuice juice = new FruitJuice();
        juice.setPacking(this.packing);
        juice.setIngredient(this.ingredient);
        juice.setDrink(this.drink);
        return juice;
    }
}
